package net.jingkao.app.common;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;

/**
 * App追踪
 * @author chao
 *
 */
public class MobileTracer {
	
	private static final Map<String, Long> EventCounters= new HashMap();
	
	/**
	 * 事件开始
	 * @param context
	 * @param msg
	 * @param args
	 */
	public static void onEventBegin(Context context, String msg, Object... args){
//		MobileProbe.onEventBegin(context, String.format(msg, args));
	}
	
	/**
	 * 事件结束
	 * @param context
	 * @param msg
	 * @param args
	 */
	public static void onEventEnd(Context context, String msg, Object... args){
//		MobileProbe.onEventEnd(context, String.format(msg, args));
	}
	
	/**
	 * 
	 * @param context
	 * @param msg
	 * @param args
	 */
	public static void onEvent(Context context, String msg, Object... args){
		String key = String.format(msg, args);
		synchronized (EventCounters) {
			Long counter = EventCounters.get(key);
			if(counter == null){
				counter = 0L;
			}
			counter ++;
			EventCounters.put(key, counter);
//			MobileProbe.onEvent(context, key, counter);
		}
	}

}
